package com.dingreading.cloud.soms.service.impl;

import com.dingreading.cloud.soms.entity.Relatives;
import com.dingreading.cloud.soms.entity.table.RelativesTableDef;
import com.dingreading.cloud.soms.mapper.RelativesMapper;
import com.dingreading.cloud.soms.service.RelativesService;
import com.mybatisflex.core.query.QueryCondition;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *  服务层实现。
 *
 * @author EDY
 * @since 2025-10-14
 */
@Service
public class RelativesServiceImpl extends BaseServiceImpl<RelativesMapper, Relatives, RelativesTableDef> implements RelativesService {

    @Override
    protected RelativesTableDef getTable() {
        return RelativesTableDef.relatives;
    }

    @Override
    public List<Relatives> getByMemberIdsAndGzhOpenIdAndGzhPush(List<Long> medmberIds, Integer gzhPush) {
        QueryCondition condition = QueryCondition.createEmpty();
        condition.and(table.memberId.in(medmberIds))
                .and(table.gzhOpenId.isNotNull())
                .and(table.gzhPush.eq(gzhPush));
        return getMapper().selectListByCondition(condition);
    }
}
